import java.io.File;

public class IODemo4 {
    public static void main(String[] args) {
        File file = new File("D:\\Home");
        if(file.isFile()){
            System.out.println("该File为文件!");
        }else{
            System.out.println("该File为文件目录!");
        }
        if(!file.isDirectory()){
            System.out.println("该File为文件!");
        }else{
            System.out.println("该File为文件目录!");
        }
    }
}
